<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Add ProductType</title>
</head>
<body>
<script>
	$(document).ready(function(){
	    $("table tbody tr:even").addClass("tdbgcolor1"); 
	    $("table tbody tr:odd").addClass("tdbgcolor2"); 
	});
	function checkAndSubmit(){
		var form = document.getElementById("addProductTypeForm");
		if ( $('#typeName').val() == ""){
			alert("手机类型名称不能为空");
			$('#typeName').focus();
		}
		form.submit();
	}
	function showUploadWindow(){
		var InfoW=620;
		var InfoH=400;
		var InfoUrl="edit/insert_images.action?uploadFolder=<%=com.windfone.common.Constant.UPLOAD_PRODUCT_TYPE %>";
		var str=window.showModalDialog(InfoUrl,"","dialogWidth="+InfoW+"px;dialogHeight="+InfoH+"px;center=yes;help=no;resizable=no;status=no;scroll=no");
		if ( str != undefined){
			$("#imagepath").val(str);
			$("#imagepath1").attr("src","<%=contextPath%>/"+str);
		}
	}
</script>
<form method="post" action="addProductType.action" id="addProductTypeForm">
<div align="center">新增手机类型</div>
<table width="80%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
	<tr>
		<td width="26%">手机类型名称:</td>
		<td width="74%"><input type="text" name="typeName" id="typeName" size="50" maxlength="50"/></td>
	</tr>
	<tr>
		<td >手机类型名称(英语):</td>
		<td ><input type="text" name="typenameEnglish" id="typenameEnglish" size="50" maxlength="50" ></td>
	</tr>
	<tr>
		<td>语言:</td>
		<td>
			<select name="langId" id="langId">
				<option value="0">简体</option>
				<option value="1">繁体</option>
				<option value="2">英语</option>
			</select>
		</td>
	</tr>	
	<tr>
		<td>手机图片:</td>
	  	<td>
			<img name="imagepath1" id="imagepath1" src=""/><input type="button" value="照片"  onClick="showUploadWindow()"/>
		</td>
	</tr>		
	<tr>
		<td colspan="2">
			<input type="hidden" name="imagepath" id="imagepath"/>
			<input type="button" value="Save"  onclick="checkAndSubmit()"/>&nbsp;
			<input type="button" value="reset" />&nbsp;
			<input	type="button" value="返回"  onclick="javascript:window.history.back();" />
		</td>
	</tr>
	</table>
</form>
</body>
</html>
